package clases;

import clases.Vectores.Vectores;
import main.Errores;
import main.Global;

/**
  *  4g3nt
  *  Copyright (C) 2008  Carlos Molinero y César Andrés
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
public class Mundo implements Runnable{
    private String _idCelula;
    private Vectores _recursos;
	public Mundo()
	{
		Global.setThread(new Thread(this, "Mundo"));

	}
  public void setIdCelula(String idCelula)
  {
	  _idCelula = idCelula;
  }
  public void setRecursos(Vectores recursos)
  {
	  _recursos = recursos;
	  
  }

  public String getCelula()
  {
	  return _idCelula;
  }
	public void run() {
		
		
		
	}
	public void print()
	{
		 Global.escribir("<li class=\"closed\"><span class=\"folder\">Mundo en "+Global.getTiempo()+" ms</span>");
		 Global.escribir("<ul>");
		
                _recursos.print();
		 Global.getCelula(_idCelula).print();
		 if(!Global.getCelula(_idCelula).getPadre().equals("NULL"))
		 	{
			 Errores.insertar("El padre de la celula inicial debe valer NULL");
			 	
		 	}
		 Global.escribir("</ul>");
		 Global.escribir("</li>");
	}
}